home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / AppleScript.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  5.8 KB  |  200 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleScript.a
  3. ;
  4. ;    Contains:    AppleScript Specific Interfaces.
  5. ;
  6. ;    Version:    Technology:    AppleScript 1.1
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1992-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__APPLESCRIPT__') = 'UNDEFINED' THEN
  18. __APPLESCRIPT__ SET 1
  19.  
  20.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  21.     include 'Errors.a'
  22.     ENDIF
  23.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  24.     include 'AppleEvents.a'
  25.     ENDIF
  26.     IF &TYPE('__OSA__') = 'UNDEFINED' THEN
  27.     include 'OSA.a'
  28.     ENDIF
  29.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  30.     include 'TextEdit.a'
  31.     ENDIF
  32.  
  33. ; **************************************************************************
  34. ;    Types and Constants
  35. ;*************************************************************************
  36.  
  37. ;    The specific type for the AppleScript instance of the
  38. ;    Open Scripting Architecture type.
  39. ;
  40.  
  41.  
  42. typeAppleScript                    EQU        'ascr'
  43. kAppleScriptSubtype                EQU        'ascr'
  44. typeASStorage                    EQU        'ascr'
  45. ; **************************************************************************
  46. ;    Component Selectors
  47. ;*************************************************************************
  48.  
  49.  
  50.  
  51. kASSelectInit                    EQU        $1001
  52. kASSelectSetSourceStyles        EQU        $1002
  53. kASSelectGetSourceStyles        EQU        $1003
  54. kASSelectGetSourceStyleNames    EQU        $1004
  55.  
  56. ; **************************************************************************
  57. ;    OSAGetScriptInfo Selectors
  58. ;*************************************************************************
  59.  
  60.  
  61. kASHasOpenHandler                EQU        'hsod'
  62. ;        This selector is used to query a context as to whether it contains
  63. ;        a handler for the kAEOpenDocuments event. This allows "applets" to be 
  64. ;        distinguished from "droplets."  OSAGetScriptInfo returns false if
  65. ;        there is no kAEOpenDocuments handler, and returns the error value 
  66. ;        errOSAInvalidAccess if the input is not a context.
  67. ;    
  68.  
  69. ; **************************************************************************
  70. ;    Initialization
  71. ;*************************************************************************
  72.  
  73. ;
  74. ; pascal OSAError ASInit(ComponentInstance scriptingComponent, long modeFlags, long minStackSize, long preferredStackSize, long maxStackSize, long minHeapSize, long preferredHeapSize, long maxHeapSize)
  75. ;
  76.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  77.         Macro
  78.         _ASInit
  79.             move.l              #$001C1001,-(sp)
  80.             moveq               #0,D0
  81.             dc.w                $A82A
  82.         EndM
  83.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  84.         IMPORT_CFM_FUNCTION ASInit
  85.     ENDIF
  86.  
  87. ;        ComponentCallNow(kASSelectInit, 28);
  88. ;        This call can be used to explicitly initialize AppleScript.  If it is
  89. ;        not called, the a scripting size resource is looked for and used. If
  90. ;        there is no scripting size resource, then the constants listed below
  91. ;        are used.  If at any stage (the init call, the size resource, the 
  92. ;        defaults) any of these parameters are zero, then parameters from the
  93. ;        next stage are used.  ModeFlags are not currently used.
  94. ;        Errors:
  95. ;        errOSASystemError        initialization failed
  96. ;    
  97.  
  98. ;    These values will be used if ASInit is not called explicitly, or if any
  99. ;    of ASInit's parameters are zero:
  100. ;
  101.  
  102.  
  103. kASDefaultMinStackSize            EQU        4096
  104. kASDefaultPreferredStackSize    EQU        16384
  105. kASDefaultMaxStackSize            EQU        16384
  106. kASDefaultMinHeapSize            EQU        4096
  107. kASDefaultPreferredHeapSize        EQU        16384
  108. kASDefaultMaxHeapSize            EQU        33554432
  109. ; **************************************************************************
  110. ;    Source Styles
  111. ;*************************************************************************
  112.  
  113. ;
  114. ; pascal OSAError ASSetSourceStyles(ComponentInstance scriptingComponent, STHandle sourceStyles)
  115. ;
  116.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  117.         Macro
  118.         _ASSetSourceStyles
  119.             move.l              #$00041002,-(sp)
  120.             moveq               #0,D0
  121.             dc.w                $A82A
  122.         EndM
  123.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  124.         IMPORT_CFM_FUNCTION ASSetSourceStyles
  125.     ENDIF
  126.  
  127. ;        ComponentCallNow(kASSelectSetSourceStyles, 4);
  128. ;        Errors:
  129. ;        errOSASystemError        operation failed
  130. ;    
  131.  
  132. ;
  133. ; pascal OSAError ASGetSourceStyles(ComponentInstance scriptingComponent, STHandle *resultingSourceStyles)
  134. ;
  135.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  136.         Macro
  137.         _ASGetSourceStyles
  138.             move.l              #$00041003,-(sp)
  139.             moveq               #0,D0
  140.             dc.w                $A82A
  141.         EndM
  142.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  143.         IMPORT_CFM_FUNCTION ASGetSourceStyles
  144.     ENDIF
  145.  
  146. ;        ComponentCallNow(kASSelectGetSourceStyles, 4);
  147. ;        Errors:
  148. ;        errOSASystemError        operation failed
  149. ;    
  150.  
  151. ;
  152. ; pascal OSAError ASGetSourceStyleNames(ComponentInstance scriptingComponent, long modeFlags, AEDescList *resultingSourceStyleNamesList)
  153. ;
  154.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  155.         Macro
  156.         _ASGetSourceStyleNames
  157.             move.l              #$00081004,-(sp)
  158.             moveq               #0,D0
  159.             dc.w                $A82A
  160.         EndM
  161.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  162.         IMPORT_CFM_FUNCTION ASGetSourceStyleNames
  163.     ENDIF
  164.  
  165. ;        ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  166. ;        This call returns an AEList of styled text descriptors the names of the
  167. ;        source styles in the current dialect.  The order of the names corresponds
  168. ;        to the order of the source style constants, below.  The style of each
  169. ;        name is the same as the styles returned by ASGetSourceStyles.
  170. ;        
  171. ;        Errors:
  172. ;        errOSASystemError        operation failed
  173. ;    
  174.  
  175. ;    Elements of STHandle correspond to following categories of tokens, and
  176. ;    accessed through following index constants:
  177. ;
  178.  
  179.  
  180. kASSourceStyleUncompiledText    EQU        0
  181. kASSourceStyleNormalText        EQU        1
  182. kASSourceStyleLanguageKeyword    EQU        2
  183. kASSourceStyleApplicationKeyword EQU    3
  184. kASSourceStyleComment            EQU        4
  185. kASSourceStyleLiteral            EQU        5
  186. kASSourceStyleUserSymbol        EQU        6
  187. kASSourceStyleObjectSpecifier    EQU        7
  188. kASNumberOfSourceStyles            EQU        8
  189.  
  190.     ENDIF ; __APPLESCRIPT__ 
  191.  
  192.